.net mvc foreach index

72

.net mvc foreach index -

@(int i = 0;)
@foreach (var item in myList)
{
  @(i++;)
}

.net mvc foreach index -

@{int i = 0;}
@foreach (var item in myList)
{
  @(i++;)
}

Comments

Submit
0 Comments